/*
 * Copyright (C) 2017-2021
 * All rights reserved, Designed By
 * Copyright authorization contact 18814114118
 */
package com.shop.cereshop.app.param.coupon;

import com.shop.cereshop.commons.domain.common.PageParam;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 优惠券跳转商品列表请求
 */
@Data
@ApiModel(value = "ActivityParam", description = "优惠券跳转商品列表请求")
public class ActivityParam extends PageParam implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 优惠券id
     */
    @ApiModelProperty(value = "优惠券id",required = true)
    private Long couponId2;

    /**
     * 判断id类型：1-平台优惠券 2-店铺优惠券
     */
    @ApiModelProperty(value = "判断id类型：1-平台优惠券 2-店铺优惠券",required = true)
    private Integer idType;
    /**
     * 活动id
     */
    @ApiModelProperty(value = "活动id(和店铺优惠券id二选一)", hidden = true)
    private Long activityId;

    /**
     * 店铺优惠券id
     */
    @ApiModelProperty(value = "店铺优惠券id", hidden = true)
    private Long shopCouponId;


    @ApiModelProperty(value = "搜索内容")
    private String keyword;

    @ApiModelProperty(value = "店铺类型：0-全部 1-同城服务(到店用) 2-线上商城(电商购) 3-同城配送(同城送)")
    private Integer shopType;

    @ApiModelProperty(value = "城市编码")
    private String cityCode;

    @ApiModelProperty(value = "筛选条件 (0-综合 1-销量 2-最新 3-价格升序 4-价格降序)")
    private Integer sortType;

//    @ApiModelProperty(value = "用户点位(经度,纬度，如 114.293589,30.597117)")
//    private String location;

    public void setKeyword(String keyword) {
        if (StringUtils.isNotBlank(keyword) && keyword.length() > 40) {
            this.keyword = keyword.substring(0, 40);
        } else {
            this.keyword = keyword;
        }
    }
}
